home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ckuker.bwr < prev    next >
Encoding:
Text File  |  1993-08-19  |  41.0 KB  |  941 lines

  1. CKUKER.BWR          "Beware File" for C-Kermit Version 5A        -*- text -*-
  2.  
  3.                  UNIX VERSION
  4.  
  5. Applies to 5A(189)
  6. Last update: Thu Aug 19 08:40:14 1993
  7.  
  8. Authors: Frank da Cruz, Christine M. Gianone, Columbia University.
  9.  
  10.   Copyright (C) 1985, 1993, Trustees of Columbia University in the City of New
  11.   York.  Permission is granted to any individual or institution to use this
  12.   software as long as it is not sold for profit.  This copyright notice must be
  13.   retained.  This software may not be included in commercial products without
  14.   written permission of Columbia University.
  15.  
  16. Report problems, suggestions, fixes, etc, to Frank da Cruz:
  17.  
  18.  Internet: fdc@watsun.cc.columbia.edu  (or)  fdc@columbia.edu
  19.  BITNET/EARN: FDCCU@CUVMA
  20.  
  21. Columbia University Academic Information Systems
  22. 612 West 115th Street, New York, NY  10025  USA
  23.  
  24.  
  25. DOCUMENTATION
  26.  
  27. C-Kermit 5A is documented in the book "Using C-Kermit" by Frank da Cruz
  28. and Christine M. Gianone, Digital Press, Burlington, MA, USA.  Digital
  29. Press ISBN: 1-55558-108-0; Prentice-Hall ISBN: 0-13-037490-3.  Price: US
  30. $34.95.  In USA, call DECdirect at 1-800-344-4825, refer to order number
  31. EY-J896E-DP.
  32.  
  33.  
  34. FILES
  35.  
  36. File naming conventions are listed in ckaaaa.hlp.
  37.  
  38. UNIX installation instructions are in the make file (makefile or ckuker.mak),
  39. with further details in ckuins.doc and ckccfg.doc.
  40.  
  41. Updates to the software are listed in ckc*.upd.
  42.  
  43. BINARIES
  44.  
  45. Warning: It is often dangerous to run a binary C-Kermit (or any other)
  46. program built on a different computer.  Particularly if that computer had a
  47. different C compiler, libraries, operating system version, processor features,
  48. etc, and especially if the program was built with shared libraries.  
  49.  
  50. It is often OK to run a binary built on an earlier OS version, but it is
  51. rarely possible (or safe) to run a binary built on a later one, for example
  52. a to run binary built under SunOS 4.1.2 on a SunOS 4.1.1 system.
  53.  
  54. When in doubt, build C-Kermit from the source code on the system where it is
  55. to be run.
  56.  
  57.  
  58. KNOWN BUGS AND LIMITATIONS
  59.  
  60. C-Kermit does not work correctly on certain UNIX workstations in certain
  61. environments:
  62.  
  63.  - On the NeXT when invoked directly from the NeXTSTEP File Viewer or Dock.
  64.    You must invoke Kermit from a "terminal", Stuart, or xterm window.
  65.  - On a NeXT with NeXTSTEP 3.0 to which you have established an rlogin
  66.    connection, due to a bug in NeXTSTEP 3.0, which has been reported to NeXT.
  67.  - On a SUN SPARCstation in an Open Windows window with scrolling enabled.
  68.    Disable scrolling, or else invoke Kermit in a terminal emulation window
  69.    (xterm, crttool, vttool) under SunView.
  70.  - On a remote UNIX system, when used through the GNU "screen" program.  In
  71.    this case, terminal connections to the remote UNIX system work, but
  72.    attempts to transfer files fail because the screen optimization (or at
  73.    least, line wrapping, control-character absorption) done by this package
  74.    interferes with Kermit's packets. 
  75.  
  76. The (first) problem on the NeXT is that terminal-oriented gtty, stty, & ioctl
  77. calls don't work on the little window that NeXTSTEP pops up for non-NeXTSTEP
  78. applications like Kermit.  CBREAK and No-ECHO settings do not take effect in
  79. the command parser -- commands are parsed strictly line at a time.  "set line
  80. /dev/cua" works.  During CONNECT mode, the console stays in cooked mode, so
  81. characters are not transmitted until carriage return or linefeed is typed, and
  82. you can't escape back.  If you want to run Kermit directly from the File
  83. Viewer, then launch it from a shell script that puts it in the desired kind of
  84. window, something like this (for "terminal"):
  85.  
  86.   Terminal -Lines 24 -Columns 80 -WinLocX 100 -WinLocY 100 $FONT $FONTSIZE \
  87.   -SourceDotLogin -Shell /usr/local/bin/kermit &
  88.  
  89. On the Sun with Open Windows, an additional symptom has been reported:
  90. outbound SunLink X.25 connections "magically" translate CR typed at the
  91. keyboard into LF before transmission to the remote host.  This doesn't happen
  92. under SunView.
  93.  
  94. On UNIX workstations equipped with DOS simulators like SoftPC, watch out for
  95. what these simulators do to the serial port drivers.  After using a DOS
  96. simulator, particularly if you use it to run DOS communications software, you
  97. might have to reconfigure the serial ports for use by UNIX.
  98.  
  99. Under the bash shell (versions prior to 1.07 from CWRU), "pushing" to an
  100. inferior shell and then exiting back to Kermit leaves Kermit in the background
  101. such that it must be explicitly fg'd.  This is reportedly fixed in version
  102. 1.07 of bash.
  103.  
  104. Interruption by Ctrl-Z makes UNIX C-Kermit try to suspend itself with
  105. kill(0,SIGSTOP), but only on systems that support job control, as determined
  106. by whether the symbol SIGTSTP is defined (or on POSIX or SVR4 systems, if
  107. syconf(_SC_JOB_CONTROL) or _POSIX_JOB_CONTROL in addition to SIGTSTP).
  108. However, if Kermit is running under a login shell (such as the original Bourne
  109. shell) that does not support job control, the user's session hangs and must be
  110. logged out from another terminal, or hung up on.  There is no way Kermit can
  111. defend itself against this.  If you use a non-job control shell on a computer
  112. that supports job control, give a command like "stty susp undef" to fix it so
  113. the suspend signal is not attached to any particular key, or give the command
  114. SET SUSPEND OFF to C-Kermit, or build C-Kermit with -DNOJC.
  115.  
  116. Reportedly, DEC ULTRIX 4.3 is immune to C-Kermit's disabling of SIGQUIT,
  117. that is the signal that is generated when the user types Ctrl-\, which kills
  118. the current process (i.e. C-Kermit) and dumps core.  Diagnosis and cure
  119. unknown.  Workaround: before starting C-Kermit -- or for that matter, when you
  120. first log in because this applies to all processes, not just Kermit -- give
  121. the following UNIX command:
  122.  
  123.   stty quit undef
  124.  
  125. The RS/6000 version does not do anything about SIGDANGER, an AIX-specific
  126. signal sent to all processes when system memory or swap space begins to run
  127. short.  To avoid being killed under these conditions, C-Kermit should catch
  128. SIGDANGER.  More info needed about how to do this.
  129.  
  130. Running sz or rz for Zmodem transfers under C-Kermit ("run rz", "run sz file")
  131. does not work on System V/386 R4, and perhaps also other System V UNIX
  132. implementations.  Reason unknown, no known workaround.  The same operation
  133. works OK in Berkeley-based UNIX versions, for example SunOS 4.x.
  134.  
  135.  
  136. INITIALIZATION FILE
  137.  
  138. C-Kermit's initialization file for UNIX is .kermrc (lowercase, starts with
  139. period) in your home directory.  C-Kermit identifies your home directory based
  140. on the environment variable, HOME.  Most UNIX systems set this variable
  141. automatically when you log in.  If C-Kermit can't find your initialization
  142. file, check your HOME variable:
  143.  
  144.   echo $HOME      (at the UNIX prompt)
  145.  
  146. or:
  147.  
  148.   echo \$(HOME)   (at the C-Kermit prompt)
  149.  
  150. If HOME is not defined, or is defined incorrectly, add the appropriate
  151. definition to your UNIX .profile or .login file, depending on your shell:
  152.  
  153.   setenv HOME full-pathname-of-your-home-directory  (C-Shell, .login file)
  154.  
  155. or:
  156.  
  157.   set HOME=full-pathname-of-your-home-directory     (sh, ksh, .profile file)
  158.   export HOME
  159.  
  160. NOTE: Various other operations depend on the correct definition of HOME.
  161. These include the "tilde-expansion" feature, which allows you to refer to
  162. your home directory as "~" in filenames used in C-Kermit commands, e.g.
  163.  
  164.   send ~/.kermrc
  165.  
  166. as well as the \v(home) variable.
  167.  
  168. The TAKE command does not search your UNIX PATH for command files.
  169.  
  170.  
  171. COMMUNICATION SPEED SELECTION
  172.  
  173. Version 7 based UNIX implementations, including 4.3 BSD and earlier and
  174. UNIX systems based upon BSD, use a 4-bit field to record a serial device's
  175. terminal speed.  This leaves room for 16 speeds, which are normally:
  176.  
  177.   0, 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2400, 4800, and 9600
  178.  
  179. The remaining two are usually called EXTA and EXTB, and are defined by the
  180. particular UNIX implementation.  C-Kermit determines which speeds are
  181. available on your system based on whether symbols for them are defined in your
  182. terminal device header files.  EXTA is generally assumed to be 19200 and EXTB
  183. 38400, but these assumptions might be wrong, or they might not apply to a
  184. particular device that does not support these speeds.  Presumably, if you try
  185. to set a speed that is not legal on a particular device, the driver will
  186. return an error, but this can not be guaranteed.
  187.  
  188. On these systems, it is usually not possible to select a speed of 14400 bps
  189. for use with V.32bis modems.  In that case, use 19200 or 38400 bps, configure
  190. your modem to lock its interface speed and to use RTS/CTS flow control, and
  191. tell C-Kermit to SET SPEED RTS/CTS and SET DIAL SPEED-MATCHING OFF.
  192.  
  193. Reportedly some recent versions of UNIX, and/or terminal device drivers that
  194. come with certain third-party add-in high-speed serial communication
  195. interfaces, use the low "baud rates" to stand for higher ones.  For example,
  196. SET SPEED 50 gets you 57600 bps; SET SPEED 75 gets you 76800; SET SPEED 110
  197. gets 115200.
  198.  
  199. The situation is similar, but different, in System V.  SVID Third Edition
  200. lists the same speeds, 0 through 38400.
  201.  
  202.  
  203. COMMUNICATIONS AND DIALING
  204.  
  205. First, make sure your dialout line is correctly configured for dialing out
  206. (as opposed to login).  The method for doing this is different for each kind
  207. of UNIX system.  Consult your system documentation for configuring lines for
  208. dialing out (for example, SUN SparcStation IPC users should read the section
  209. "Setting up Modem Software" in the Desktop SPARC Sun System & Network
  210. Manager's Guide).
  211.  
  212. Certain operations driven by RS-232 modem signal do not work on DECstations or
  213. other DEC platforms whose serial interfaces use MMP connectors (DEC version of
  214. RJ45 telephone jack with with offset tab).  These connectors convey only the
  215. DSR and DTR modem signals, but not carrier (CD), RTS, CTS, or RI.  Use SET
  216. CARRIER OFF to enable communication, or "hotwire" DSR to CD.
  217.  
  218. Symptom: DIAL works, but a subsequent CONNECT command does not.  Diagnosis:
  219. the modem is not asserting Carrier Detect (CD) after the connection is made,
  220. or the cable does not convey the CD signal.  Cure: Reconfigure the modem,
  221. replace the cable.  Workaround: SET CARRIER OFF (at least in System-V based
  222. UNIX versions).
  223.  
  224. Kermit tries to use the 8th bit for data when parity is NONE, and this
  225. generally works on real UNIX terminal (tty) devices, but it often does not
  226. work when the UNIX system is accessed over a network via telnet or rlogin
  227. protocols, including (in many cases) through terminal servers.  For example,
  228. an Encore computer with Annex terminal servers only gives a 7-bit path if
  229. the rlogin protocol is selected in the terminal server but it gives the full
  230. 8 bits if the proprietary RDP protocol is used.
  231.  
  232. If file transfer does not work through a host to which you have rlogin'd,
  233. use "rlogin -8" rather than "rlogin".  If that doesn't work, tell both Kermit
  234. programs to "set parity space".
  235.  
  236. The Encore TELNET server does not allow long bursts of input.  When you have
  237. a TELNET connection to an Encore, tell C-Kermit on the Encore to SET RECEIVE
  238. PACKET-LENGTH 200 or thereabouts.
  239.  
  240. For Berkeley-UNIX-based systems (4.3BSD and earlier), Kermit includes code to
  241. use LPASS8 mode when parity is none, which is supposed to allow 8-bit data and
  242. Xon/Xoff flow control at the same time.  However, as of edit 174, this code is
  243. entirely disabled because it is unreliable: even though the host operating
  244. system might (or might not) support LPASS8 mode correctly, the host access
  245. protocols (terminal servers, telnet, rlogin, etc) generally have no way of
  246. finding out about it and therefore render it ineffective, causing file
  247. transfer failures.  So as of edit 174, Kermit once again uses rawmode for
  248. 8-bit data, and so there is no Xon/Xoff flow control during file transfer or
  249. terminal emulation.
  250.  
  251. Also on Berkeley-based systems (4.3 and earlier), there is apparently no way
  252. to configure a dialout line for proper carrier handling, i.e. ignore carrier
  253. during dialing, require carrier thereafter, get a fatal error on any attempt
  254. to read from the device after carrier drops (this is handled nicely in System
  255. V by manipulation of the CLOCAL flag).  The symptom is that carrier loss does
  256. not make C-Kermit pop back to the prompt automatically.  This is evident on
  257. the NeXT, for example, but not on SUNOS, which supports the CLOCAL flag.  This
  258. is not a Kermit problem, but a limitation of the underlying operating system.
  259. For example, the cu program on the NeXT doesn't notice carrier loss either,
  260. whereas cu on the SUN does.
  261.  
  262. DIAL might not work.  If it doesn't, try SET DIAL HANGUP OFF before the DIAL
  263. command.  Also, SET DIAL DISPLAY ON to watch what's happening.  See section 8
  264. of ckuins.doc.  As a last resort, don't use the DIAL command at all; SET
  265. CARRIER OFF and CONNECT to the modem and dial interactively, or write a script
  266. program to dial the modem.
  267.  
  268. On certain AT&T UNIX systems equipped with AT&T modems, DIAL and HANGUP don't
  269. work right.  Workarounds: (1) SET DIAL HANGUP OFF before attempting to dial;
  270. (2) If HANGUP doesn't work, SET LINE, and then SET LINE <device> to totally
  271. close and reopen the device.  If all else fails, SET CARRIER OFF.
  272.  
  273. C-Kermit does not contain any particular support for AT&T DataKit devices.
  274. You can use Kermit software to dial in to a DataKit line, but C-Kermit does
  275. not contain the specialized code required to dial out from a DataKit line.  If
  276. the UNIX system is connected to DataKit via serial ports, dialout should work
  277. normally (e.g. set line /dev/ttym1, set speed 19200, connect, and then see the
  278. DESTINATION: prompt, from which you can connect to another computer on the
  279. DataKit network or to an outgoing modem pool, etc).  But if the UNIX system
  280. is connected to the DataKit network through the special DataKit interface
  281. board, then SET LINE to a DataKit pseudodevice (such as /dev/dk031t) will not
  282. work (you must use the DataKit "dk" or "dkcu" program instead).
  283.  
  284. In some BSD-based UNIX C-Kermit versions, SET LINE to a port that has nothing
  285. plugged in to it with SET CARRIER ON will hang the program (as it should), but
  286. it can't be interrupted with Ctrl-C.  The interrupt trap is correctly armed,
  287. but apparently the UNIX open() call cannot be interrupted in this case.  When
  288. SET CARRIER is OFF or AUTO, the SET LINE will eventually return, but then the
  289. program hangs (uninterruptibly) when the EXIT or QUIT command (or, presumably,
  290. another SET LINE command) is given.  The latter is probably because of the
  291. attempt to hang up the modem.  (In edit 169, a timeout alarm was placed around
  292. this operation.)
  293.  
  294. SET CARRIER ON, when used on the SUNOS 4.1 version of C-Kermit (compiled in
  295. the BSD universe), causes the program to hang uninterruptibly when SET LINE
  296. is issued for a device that is not asserting carrier.  When Kermit is built
  297. in the Sys V universe on the same computer, there is no problem (it can be
  298. interrupted with Ctrl-C).  This is apparently a limitation of the BSD-style
  299. tty driver.
  300.  
  301. SunOS 4.1 C-Kermit has been observed to dump core when running a complicated
  302. script program under cron.  The dump invariably occurs in ttoc(), while trying
  303. to output a character to a TCP/IP TELNET connection.  ttoc() contains a
  304. write() call, and when the system or the network is very busy, the write()
  305. call can get stuck for long periods of time.  To break out of deadlocks caused
  306. by stuck write() calls, there is an alarm around the write().  It is possible
  307. that the core dump occurs when this alarm signal is caught.
  308.  
  309. One user of C-Kermit 5A(179) on an RS/6000 with AIX 3.2.0 reported that (at
  310. least on TCP/IP connections, i.e. SET HOST out of C-Kermit) escaping back
  311. works only once.  After connecting a second time, the escape character is
  312. ignored.  Other users of the AIX 3.2.0 report that this does not happen.  For
  313. now, a mystery.  This behavior is not observed on AIX 3.1 or AIX 3.2.1.
  314.  
  315. Many problems reported with bidirectional terminal lines on AIX 3.2.x on the
  316. RS/6000.  Workaround: don't use bidirectional terminal lines, or write some
  317. kind of shell script that turns getty off on the line before starting Kermit,
  318. or before Kermit attempts to do the SET LINE.
  319.  
  320. Or use vendor-provided utilities for switching the directionality of a modem
  321. line, such as SCO's "enable" and "disable" commands.  For example, to dial
  322. out on tty1a, which is normally set up for logins:
  323.  
  324.   disable tty1a
  325.   kermit -l /dev/tty1a
  326.   enable tty1a
  327.  
  328. In SCO Xenix, you must use SET CARRIER ON *and* use the upper-case tty device
  329. name in order to have carrier detection.  SET CARRIER OFF should work with
  330. either upper or lowercase tty devices.  SET CARRIER AUTO is the same as OFF.
  331.  
  332. With SET DIAL HANGUP OFF in effect, the DIAL command might work only once,
  333. but not again on the same device.  In that case, give a SET LINE command
  334. with no arguments to close the device, and then another SET LINE command for
  335. the desired device.  Or rebuild your version of Kermit with the -DCLSOPN
  336. compile-time switch (see ckuins.doc).
  337.  
  338. The DIAL command does not always seem to wait the full announced interval for
  339. the call to complete.  Probably something to do with alarms stomping over each
  340. other.  Try SET DIAL TIMEOUT <sec> to increase the interval.
  341.  
  342. The DIAL command says "To cancel: Type your interrupt character (normally
  343. Ctrl-C)."  This is just one example of where program messages and
  344. documentation assume your interrupt character is Ctrl-C.  But it might be
  345. something else.  In most (but not necessarily all) cases, the character
  346. referred to is the one that generates the SIGINT signal.  If Ctrl-C doesn't
  347. act as an interrupt character for you, type the Unix command "stty -a" or
  348. "stty all" or "stty everything" to see what your interrupt character is.
  349. (Kermit could be made to find out what the interrupt character is, but this
  350. would require a lot of system-dependent coding and #ifdefs, and a new routine
  351. and interface between the system-dependent and system-independent parts of the
  352. program.)
  353.  
  354. (On a similar note, Kermit could find out what your erase, line-delete,
  355. word-delete, etc, characters are and use them in the command parser instead of
  356. hardwired DEC-style editing characters.  This is on the list of things to do.)
  357.  
  358. Reportedly, all versions of IBM AIX use the same (undocumented) lockfile
  359. conventions as RTAIX.  If this is true, the "makes" for PS/2 AIX, AIX/370,
  360. and RS/6000 will have to be changed to use the RTAIX convention (it may be
  361. sufficient to simply add -DRTAIX to the make entry).
  362.  
  363. C-Kermit SET HOST or TELNET from AIX on an RS/6000 to another RS/6000 won't
  364. work right unless you set your local terminal type to something other than
  365. AIXTERM.  When your terminal type is AIXTERM, AIX TELNET sends two escapes
  366. whenever you type one, and the AIX telnet server swallows one of them.
  367. This has something to do with "hft" device.  This behavior is reportedly
  368. removed in AIX 3.2.
  369.  
  370. In general, the hangup operation on a serial communication device is prone
  371. to failure.  C-Kermit tries to support many, many different kinds of
  372. computers, and there seems to be no portable method for hanging up a modem
  373. connection (i.e. turning off the RS-232 DTR signal and then turning it back on
  374. again).  If HANGUP, DIAL, and/or Ctrl-\H do not work for you, and you are a
  375. programmer, look at the tthang() function in ckutio.c and see if you can add
  376. code to make it work correctly for your system, and send the code to the
  377. address above.
  378.  
  379. Even when Kermit's modem-control software is configured correctly for your
  380. computer, it can only work right if your modem is also configured to assert
  381. the CD signal when it is connected to the remote modem and to hang up the
  382. connection when your computer drops the DTR signal.  So before deciding Kermit
  383. doesn't work with your modem, check your modem configuration AND the cable
  384. connecting your modem to the computer -- it should be a straight-through modem
  385. cable conducting the signals FG, SG, TD, RD, RTS, CTS, DSR, DTR, CD, and RI.
  386.  
  387. Certain UNIX systems, such as SCO Xenix, provide different names for the same
  388. device.  In Xenix, /dev/tty1a refers to a terminal device that has no modem
  389. control; open, read, write, and close operations do not depend on carrier.  On
  390. the other hand, /dev/tty1A (same name, but with final letter upper case), is
  391. the same device with modem control, in which carrier is required (the SET LINE
  392. command does not complete until carrier appears, read/write operations fail if
  393. there is no carrier, etc).  Similarly, NeXT computers use different names for
  394. the same communication device depending on whether RTS/CTS flow control is to
  395. be used (e.g. /dev/cufa for RTS/CTS, /dev/cua for no RTS/CTS).
  396.  
  397. On Sun computers with SunOS 4.0 or 4.1, SET FLOW RTS/CTS works only if the
  398. carrier signal is present from the communication device at the time when
  399. C-Kermit enters packet mode or CONNECT mode.  If carrier is not sensed (e.g.
  400. when dialing), C-Kermit does not attempt to turn on RTS/CTS flow control.
  401. This is because the SunOS serial device driver does not allow characters to
  402. be output if RTS/CTS is set (CRTSCTS) but carrier (and DSR) are not present.
  403.  
  404. The SET FLOW-CONTROL KEEP option should be given *before* any communication
  405. (dialing, terminal emulation, file transfer, INPUT/OUTPUT/TRANSMIT, etc) is
  406. attempted, if you want C-Kermit to use all of the device's preexisting
  407. flow-control related settings.  The default flow-control setting is XON/XOFF,
  408. and it will take effect when the first communication-related command is given,
  409. and a subsequent SET FLOW KEEP command will not necessarily know how to
  410. restore *all* of the device's original flow-control settings.
  411.  
  412. On the NeXT, Kermit reportedly (by TimeMon) causes the kernel to use a lot of
  413. CPU time when using a "set line" connection.  That's because there is no DMA
  414. channel for the NeXT serial port, so the port must interrupt the kernel for
  415. each character in or out.
  416.  
  417. Under BSD UNIX versions, it takes a long time to complete operations that
  418. involve changing TTY modes.  This is because the BSD stty calls do not wait
  419. for pending i/o to complete before returning, and so Kermit must sleep
  420. before invoking these functions.  System V versions don't have this problem.
  421.  
  422.  
  423. TERMINAL CONNECTION
  424.  
  425. UNIX C-Kermit's SET KEY command currently can not be used with keys that
  426. generate "wide" scan codes or multibyte sequences, such as workstation 
  427. function keys.
  428.  
  429.  
  430. FILE TRANSFER
  431.  
  432. Optimum file transfer performance is a matter of tuning parameters like packet
  433. length and window size, and, on serial connections, of ensuring there is an
  434. effective flow control method, preferably hardware (such as RTS/CTS).
  435. However, a fully-configured C-Kermit program can be slower than than a
  436. minimally configured one simply because of its size.  A command-line-only
  437. version that is stripped of every conceivable feature not affecting file
  438. transfer (such as "sunos41m" for the Sun or "dellsys5r4m" for Dell) can move
  439. files considerably faster than a full-featured one.  Thus, it might make sense
  440. to keep a minimal version available as well as a full-featured one.  See the
  441. files ckuins.doc and ckccfg.doc as well as the makefile for how to do this.
  442.  
  443. UNIX C-Kermit does not reject incoming files on the basis of size.  There
  444. appears to be no good (reliable, portable) way to determine in advance how
  445. much disk space is available.
  446.  
  447. File transfer will fail if the incoming file is bigger than your ULIMIT.
  448. Use the UNIX ulimit command to examine or change your ULIMIT (the number is
  449. in 512-byte blocks, i.e. 0.5K).
  450.  
  451. UNIX C-Kermit discards all carriage returns from incoming files when in text
  452. mode.
  453.  
  454. If a file arrives that has the same name as a directory, and C-Kermit's FILE
  455. COLLISION setting is BACKUP, C-Kermit will either: (a) rename the directory,
  456. or (b) not be able to rename the directory and so will refuse the incoming
  457. file with the message "Can't transform filename".  Similarly, if C-Kermit's
  458. FILE COLLISION setting is OVERWRITE, C-Kermit will, hopefully (!), not be able
  459. to delete the directory, and so will refuse the incoming file.
  460.  
  461. If you SET FILE DISPLAY FULLSCREEN, and C-Kermit complains "Sorry, terminal
  462. type not supported", it means that the terminal library (termcap or termlib)
  463. that C-Kermit was built for does not know about a terminal whose name is the
  464. current value of your TERM environment variable.  If this happens, EXIT from
  465. C-Kermit and set a UNIX terminal type from among the supported values, or else
  466. have an entry for your terminal type added to the system termcap and/or
  467. terminfo database.
  468.  
  469. If you attempt to suspend C-Kermit during local-mode file transfer and then
  470. continue it in the background (via bg), it will block for "tty output" if
  471. you are using the FULLSCREEN file transfer display.  This is apparently
  472. a problem with curses.  Moving a local-mode file transfer back and forth
  473. between foreground and background works correctly, however, with the SERIAL,
  474. CRT, or NONE file transfer displays.
  475.  
  476. Reportedly, when using "MSEND *" from a 14-character filename UNIX system to
  477. another system (e.g. BSD) that allows longer names, with SET FILE NAMES
  478. LITERAL, any files with 14-character names will have a space added to the end
  479. of the name on the receiving machine.
  480.  
  481. One user of C-Kermit on SCO UNIX 3.2.4 reports that C-Kermit core dumps when
  482. receiving files in local mode.  The crash invariably occurs when the 16384th
  483. byte arrives, obviously indicating some kind of int/long, or short/int, or
  484. similar mismatch in argument-passing -- no doubt the byte count.  Other users
  485. of SCO UNIX 3.2.4, built using the same makefile entry, report that they can
  486. receive files much longer than 16384 with no problem at all.  Maybe it depends
  487. on which file transfer display is being used?  If this happens to you, try
  488. using a different file transfer display (SET FILE DISPLAY NONE, SERIAL, CRT,
  489. or FULLSCREEN).
  490.  
  491.  
  492. EXTERNAL FILE TRANSFER PROTOCOLS
  493.  
  494. UNIX C-Kermit can be used in conjunction with other communications software
  495. in various ways.  C-Kermit can be invoked from another communications program
  496. as an "external protocol", and C-Kermit can also invoke other communication
  497. software to perform external protocols.
  498.  
  499. This sort of operation makes sense only when you are dialing out from your
  500. UNIX system.  If the UNIX system is the one you have dialed in to, you don't
  501. need any of these tricks.  Just run the desired software on your UNIX system
  502. instead of Kermit.  When dialing out from a UNIX system, the difficulty is
  503. getting two programs to share the same communication device in spite of the
  504. UNIX UUCP lockfile mechanism, which would normally prevent any sharing.
  505.  
  506.   1. C-Kermit as an External Protocol
  507.  
  508. "pcomm" is a general-purpose terminal program that provides file transfer
  509. capabilities itself (X- and YMODEM variations) and the ability to call on
  510. external programs to do file transfers (ZMODEM and Kermit, for example).  You
  511. can tell pcomm the command to execute to send or receive a file with an
  512. external protocol:
  513.             send                receive
  514.     ZMODEM        sz <filename>            rz
  515.     Kermit        kermit -s <filename>        kermit -r
  516.  
  517. pcomm runs external programs for file transfer by making stdin and stdout
  518. point to the modem port, and then exec-ing "/bin/sh -c xxx" (where xxx is the
  519. appropriate command).  However, C-Kermit does not treat stdin and stdout as
  520. the communication device unless you instruct it:
  521.  
  522.             send                receive
  523.     Kermit        kermit -l 0 -s <filename>    kermit -l 0 -r
  524.  
  525. The "-l 0" option means to use file descriptor 0 for the communication device.
  526.  
  527. In general, any program can pass any open file descriptor to C-Kermit for the
  528. communication device in the "-l" command-line option.
  529.  
  530.   2. Invoking External Protocols from C-Kermit
  531.  
  532. After you have opened a communication link with C-Kermit's SET LINE (SET PORT)
  533. or SET HOST (TELNET) command, C-Kermit makes its file descriptor available to
  534. you in the \v(ttyfd) variable so you can make it available to other programs
  535. that you RUN from C-Kermit.  Here, for example, C-Kermit runs itself as an
  536. external protocol:
  537.  
  538.   C-Kermit>set modem hayes
  539.   C-Kermit>set line /dev/acu
  540.   C-Kermit>set speed 2400
  541.   C-Kermit>dial 7654321
  542.    Call complete.
  543.   C-Kermit>echo \v(ttyfd)
  544.    3
  545.   C-Kermit>run kermit -l \v(ttyfd)
  546.  
  547. Other programs that accept open file descriptors on the command line can be
  548. started in the same way.
  549.  
  550. You can also use your shell's i/o redirection facilities to assign C-Kermit's
  551. open file descriptor (ttyfd) to stdin or stdout.  For example, the UNIX ZMODEM
  552. programs, sz and rz, when invoked as external protocols, expect to find the
  553. communication device assigned to stdin and stdout with no option for
  554. specifying any other file descriptor on the sz or rz command line.  However,
  555. you can still invoke sz and rz as exterior protocols from C-Kermit if your
  556. current shell ($SHELL variable) is ksh (the Korn shell) or bash (the
  557. Bourne-Again shell), which allows assignment of arbitrary file descriptors to
  558. stdin and stdout:
  559.  
  560.   C-Kermit> run rz <&\v(ttyfd) >&\v(ttyfd)
  561.  
  562. Here are some macros from Rick Calder <rick@rick.att.com> for invoking
  563. external protocols from C-Kermit.  These assume your shell is ksh or bash, and
  564. that the sz, rz, sx, rx, etc, programs are in /usr/local/bin:
  565.  
  566. ; Send specified file(s) with ZMODEM
  567. ;
  568. define sz if = \v(argc) 1 FATAL {Send what file ?}, -
  569.   if not exist \%1 FATAL {File \%1 not found.}, -
  570.   run /usr/local/bin/sz -
  571.     \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 <&\v(ttyfd) >&\v(ttyfd), -
  572.   connect
  573.  
  574. ; Receive file or files with ZMODEM
  575. ;
  576. define rz run /usr/local/bin/rz <&\v(ttyfd) >&\v(ttyfd), connect
  577.  
  578. ; Send specified file(s) with YMODEM
  579. ;
  580. define sb if = \v(argc) 1 FATAL {Send what file ?}, -
  581.   if not exist \%1 FATAL {File \%1 not found.}, -
  582.   run /usr/local/bin/sb -
  583.     \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 <&\v(ttyfd) >&\v(ttyfd), -
  584.   connect
  585.  
  586. ; Receive with YMODEM
  587. ;
  588. define rb run /usr/local/bin/rb <&\v(ttyfd) >&\v(ttyfd), connect
  589.  
  590. ; Send a single file with XMODEM
  591. ;
  592. define sx if = \v(argc) 1 FATAL {Send what file ?}, -
  593.   if not exist \%1 FATAL {File \%1 not found.}, -
  594.   run /usr/local/bin/sx \%1 \%2 \%3 \%4 \%5 \%6 \%7 \v(ttyfd) >&\v(ttyfd), -
  595.   connect
  596.  
  597. ; Receive with XMODEM (receiver must be told the filename too)
  598. ;
  599. define rx if = \v(argc) 1 FATAL {Receive what file ?}, -
  600.   run /usr/local/bin/rx \%1 <&\v(ttyfd) >&\v(ttyfd), -
  601.   connect
  602.  
  603. Put these definitions in your .mykermrc file and use them like this:
  604.  
  605.   C-Kermit>rz
  606.   C-Kermit>sz oofa.txt
  607.  
  608. etc.  As Rick says, "This now gives me one terminal emulator to use for both
  609. my UNIX and my MSDOS systems, with full file transfer protocol options,
  610. regardless of what the remote offers.  Finally, one size fits all!"  To that,
  611. we should add that X-, Y-, and ZMODEM need be used only when Kermit transfers
  612. are not available, since with long packets, sliding windows, and
  613. control-character unprefixing, Kermit is just as fast -- and almost always
  614. faster -- than X-, Y-, and ZMODEM.
  615.  
  616.  
  617. MISCELLANEOUS
  618.  
  619. One user reported trouble running C-Kermit on a NeXT from within NeXT's
  620. Subprocess class under NeXTstep 3.0, and/or when rlogin'd from one NeXT to
  621. another: Error opening /dev/tty:, congm: No such device or address.  Diagnosis:
  622. Bug in NeXTSTEP 3.0, cure unknown.
  623.  
  624. If C-Kermit has problems opening files in writable directories when it is
  625. installed setuid or setgid on BSD-based versions of UNIX such
  626. as NeXT Mach 3.0, it probably needs to be rebuild with the -DSW_ACC_ID
  627. comilation switch (see ckuins.doc).
  628.  
  629. Reportedly, when coming into a Sequent UNIX (DYNIX) system through an X.25
  630. connection, Kermit doesn't work right because the Sequent's FIONREAD ioctl
  631. returns incorrect data.  To work around, use the 1-character-at-a-time version
  632. of myread() in ckutio.c (i.e. undefine MYREAD in ckutio.c and rebuild the
  633. program).
  634.  
  635. There have been reports of file transfer failures on SUN 3 systems when using
  636. long packets and/or large window sizes.  One user says that when this happens,
  637. the console issues many copies of this message:
  638.  
  639.   chaos vmunix: zs1: ring buffer overflow
  640.  
  641. This means that SunOS (UNIX) is not scheduling Kermit frequently enough to
  642. service interrupts from the zs serial device (Zilog 8350 SCC serial
  643. communication port) before its input silo overflows.  Workaround: use smaller
  644. packets and/or a smaller window size, or use "nice" to increase Kermit's
  645. priority.  Use hardware flow control if available, or remove other active
  646. processes before running Kermit.
  647.  
  648. One user reports that C-Kermit built on SCO UNIX 3.2.4 (ODT 2.0) consistently
  649. crashes as soon as it receives the 16384th byte of an incoming file, which
  650. seems to indicate a short-vs-int conversion problem (file length becoming
  651. negative).  Another user, who built and runs the same version of C-Kermit in
  652. exactly the same environment, reports that this problem does not occur.  The
  653. difference is thought to be a compiler bug for which an SCO patch was
  654. installed on the latter system, but not the former.
  655.  
  656. ------------------------------
  657.  
  658. USER REPORTS -
  659.  
  660. Date: Thu, 12 Mar 92 1:59:25 MEZ
  661. From: Walter Mecky <walter@rent-a-guru.de>
  662. Subject: Help.Unix.sw
  663. To: svr4@pcsbst.pcs.com, source@usl.com
  664.  
  665. PRODUCT:    Unix
  666. RELEASE:    Dell SVR4 V2.1 (is USL V3.0)
  667. MACHINE:    AT-386
  668. PATHNAME:    /usr/lib/libc.so.1
  669.         /usr/ccs/lib/libc.a
  670. ABSTRACT:    Function ttyname() does not close its file descriptor
  671. DESCRIPTION:
  672.     ttyname(3C) opens /dev but never closes it. So if it is called
  673.     often enough the open(2) in ttyname() fails. Because the broken
  674.     ttyname() is in the shared lib too all programs using it can
  675.     fail if they call it often enough. One important program is
  676.     uucico which calls ttyname for every file it transfers.
  677.  
  678. Here is a little test program if your system has the bug:
  679.  
  680. #include <stdlib.h>
  681. #include <stdio.h>
  682. main() {
  683.     int i = 0;
  684.     while (ttyname(0) != NULL)
  685.       i++;
  686.     perror("ttyname");
  687.     printf("i=%d\n", i);
  688. }
  689.  
  690. If this program runs longer than some seconds you don't have the bug.
  691.  
  692. WORKAROUND:
  693.     None
  694. FIX:
  695.     Very easy if you have source code.
  696.  
  697. Another user reports some more explicit symptoms and recoveries:
  698.  
  699. > What happens is when invoking ckermit we get one of the following
  700. > error messages:
  701. >   You must set line
  702. >   Not a tty
  703. >   No more processes.
  704. > One of the following three actions clears the peoblem:
  705. >   shutdown -y -g0 -i6
  706. >   kill -9 the ttymon with the highest PID
  707. >   Invoke sysadm and disable then enable the line you want to use.
  708. > Turning off respawn of sac -t 300 and going to getty's and uugetty's 
  709. > does not help.
  710. > Also C-Kermit reports "?timed out closing /dev/ttyxx".
  711. > If this happens all is well.
  712.  
  713. ------------------------------
  714.  
  715. Date: Wed, 6 Jun 90 23:51:10 PDT
  716. From: dunlap@apl-em.apl.washington.edu (John Dunlap)
  717. To: fdc@watsun.cc.columbia.edu
  718. Subject: Re:  C-Kermit 5A Edit 144
  719.  
  720. I should mention that I have discovered a bug in C-Kermit using HP-UX version
  721. 5.21 on the HP-9000 series 500 computers.  This bug seems to have been present
  722. at least as far back as version 095.  It only occurs when the controlling
  723. terminal is using an HP-27140 six port modem mux.  The problem is not present
  724. if the controlling terminal is logged into an HP-27130 eight port mux.  The
  725. symptom is that just after dialing successfully and connecting Kermit locks up
  726. and the port is unusable until both forks of Kermit and the login shell are
  727. killed.
  728.  
  729. This may be why some people are saying that Kermit won't work for them on the
  730. series 800 HP computers -- the 27140 6 port modem mux is used on that computer
  731. while the 27140 8 port mux cannot be used.
  732.  
  733. One of these months I may be able to test this a bit more, but for the time
  734. being I just moved my terminal port to the 8 port mux!
  735.  
  736. ------------------------------
  737.  
  738. Date: Mon, 15 Jun 92 17:16:21 -0400
  739. From: fuller@wccs (Charles S. Fuller)
  740. Subject: kermit under HP-UX -- solved!
  741.  
  742. To make C-Kermit work on HP-UX 8.05 on an HP720, obtain and install HP-UX
  743. patch PHNE_0899.  This patch deals with a lot of driver issues, particularly
  744. related to communication at higher speeds.
  745.  
  746. ------------------------------
  747.  
  748. Date: Tue, 16 Oct 90 23:35:26 -0400
  749. From: wbader@scarecrow.csee.lehigh.edu (William Bader)
  750. To: fdc@watsun.cc.columbia.edu
  751. Subject: ckermit 159 notes
  752.  
  753. The changes to the update file mentioned something about putting alarms
  754. on some I/O calls to prevent flow control deadlocks.  Device drivers in
  755. Xenix (and possibly other ports of versions of AT&T Unix V.2 and V.3) have a
  756. higher priority than signals, which means that an alarm (or any signal
  757. including SIGKILL!) will not always interrupt a deadlocked read.
  758. When you turn off flow control on Xenix, there is a short window where an
  759. incoming ^S can get accepted, but no ^Q can be sent because flow control
  760. was turned off slightly after the ^S.
  761.  
  762. [C-Kermit 4C would sometimes hang for this reason, and we could kill
  763. the shell to use that terminal, but the kermit process itself would
  764. become a zombie.]
  765.  
  766. It might be possible (although not portable) to use select().
  767.  
  768. ------------------------------
  769.  
  770. (Note: the following problem also occurs on SGI and probably many other
  771. UNIX systems):
  772.  
  773. From: James Spath <spath@jhunix.hcf.jhu.edu>
  774. To: Info-Kermit-Request@cunixf.cc.columbia.edu
  775. Date: Wed, 9 Sep 1992 20:20:28 -0400
  776. Subject: C-Kermit vs uugetty (or init) on Sperry 5000
  777.  
  778. We have sucessfully compiled the above release on a Unisys/Sperry 5000/95.  We
  779. used the sys5r3 option, rather than sys5r2 since we have VR3 running on our
  780. system.  In order to allow dialout access to non-superusers, we had to do
  781. "chmod 666 /dev/tty###", where it had been -rw--w--w- (owned by uucp), and to
  782. do "chmod +w /usr/spool/locks".  We have done text and binary file transfers
  783. through local and remote connections.
  784.  
  785. The problem concerning uucp ownership and permissions is worse than I thought
  786. at first.  Apparently init or uugetty changes the file permissions after each
  787. session.  So I wrote the following C program to open a set of requested tty
  788. lines.  I run this for any required outgoing line prior to a Kermit session.
  789.  
  790.    ------ cut here -------
  791. /* opentty.c -- force allow read on tty lines for modem i/o */
  792. /* idea from: restrict.c -- Systsem 5 Admin book Thomas/Farrow p. 605 */
  793. /* /jes jim spath {spath@jhunix.hcj.jhu.edu } */
  794. /* 08-Sep-92 NO COPYRIGHT. */
  795. /* this must be suid to open other tty lines */
  796.  
  797. /* #define DEBUG */
  798. #define TTY "/dev/tty"
  799. #define LOK "/usr/spool/locks/LCK..tty"
  800. #include <stdio.h>
  801.  
  802. /* allowable lines: */
  803. #define TOTAL_LINES 3
  804. static char allowable[TOTAL_LINES][4] = { "200", "201", "300" };
  805. static int total=TOTAL_LINES;
  806. int allow;
  807.  
  808. /* states: */
  809. #define TTY_UNDEF 0
  810. #define TTY_LOCK  1
  811. #define TTY_OKAY  2
  812.  
  813. main(argc, argv)
  814. int argc; char *argv[]; {
  815.     char device[512];
  816.     char lockdev[512];
  817.     int i;
  818.     if (argc == 1) {
  819.     fprintf(stderr, "usage: open 200 [...]\n");
  820.     }
  821.     while (--argc > 0 && (*++argv) != NULL ) {
  822. #ifdef DEBUG
  823.     fprintf(stderr, "TRYING: %s%s\n", TTY, *argv);
  824. #endif
  825.     sprintf(device, "%s%s", TTY, *argv);
  826.     sprintf(lockdev, "%s%s", LOK, *argv);
  827.     allow = TTY_UNDEF; i = 0;
  828.     while (i <= total) { /* look at all defined lines */
  829. #ifdef DEBUG
  830.         fprintf(stderr, "LOCKFILE? %s?\n", lockdev);
  831. #endif
  832.         if (access(lockdev, 00) == 0) {
  833.         allow=TTY_LOCK;
  834.         break;
  835.         }
  836. #ifdef DEBUG
  837.         fprintf(stderr, "DOES:%s==%s?\n", allowable[i], *argv);
  838. #endif
  839.         if (strcmp(allowable[i], *argv) == 0)
  840.           allow=TTY_OKAY;
  841.         i++;
  842.     }
  843. #ifdef DEBUG
  844.     fprintf(stderr, "allow=%d\n", allow);
  845. #endif
  846.     switch (allow) {
  847.       case TTY_UNDEF:
  848.         fprintf (stderr, "open: not allowed on %s\n", *argv);
  849.         break;
  850.       case TTY_LOCK:
  851.         fprintf (stderr, "open: device locked: %s\n", lockdev);
  852.         break;
  853.       case TTY_OKAY:
  854.         /* attempt to change mode on device */
  855.         if (chmod (device, 00666) < 0)
  856.           fprintf (stderr, "open: cannot chmod on %s\n", device);
  857.         break;
  858.       default:
  859.         fprintf (stderr, "open: FAULT\n");
  860.     }
  861.     }
  862.     exit (0);
  863. }
  864.  
  865. ------------------------------
  866.  
  867. Date: Fri, 30 Oct 92 10:59:51 +0100
  868. From: fulvio@ssuxos.ICO.OLIVETTI.COM (Fulvio Marino)
  869. To: fdc@watsun.cc.columbia.edu
  870. Subject: Re: C-Kermit 5A(185) Ready for Testing
  871.  
  872. Some telnetd are broken (in some releases of Sun, Hitachi and X/OS Unixes):
  873. byte BUFSIZ (i.e., buf[BUFSIZ-1]) is not passed to the attached processes.
  874. Two side effects:
  875.  
  876.  a. if the receive packet-len (on remote server) is >= BUFSIZ, there is no way
  877.     to send a packet of data (the BUFSIZ-th byte is always lost)
  878.  
  879.  b. if the receive packet-len (on remote server) is < BUFSIZ, then you can
  880.     *hope* to send some packet of data: remote kernel could ``cat'' the
  881.     received data so that to give telnetd a bigger input buffer (see "a.").
  882.  
  883. Possible solutions:
  884.  
  885.   - Patch telnetd -- the best way
  886.  
  887.   - Use *very* short packets (speed is slowing down) -- the middle way
  888.  
  889.   - Change ckutio.c.  I added code to ttol(); actually, the line:
  890.  
  891.         x = write(ttyfd,s,n);    /* Write string to device */
  892.  
  893.     is writing a full packet (or a piece of it, in case of partial writes).
  894.     My idea is to split this up into many little writes, sleeping between
  895.     them; I use an "extern int splitted_bsz" to know if a ``splitting'' is
  896.     required or not; the msecs for msleep() are computed in a way that is
  897.     giving good results on X/OS.  splitted_bsz (and, possibly, the msecs to
  898.     sleep) should be set by the user only in our special case.  This code
  899.     works.  I suggest to insert it in ckutio.c only if you know that this
  900.     kind of problem is common.
  901.  
  902.     if (splitted_bsz == 0 || n <= splitted_bsz ) {
  903.         x = write(ttyfd,s,n);    /* Write string to device */
  904.     } else {
  905.         extern int    wslots;
  906.         char    *buf;
  907.         int        thiswrite, remaining;
  908.  
  909.         buf = s;
  910.         remaining = n;
  911.         for ( ; ; ) {
  912.         thiswrite = remaining > splitted_bsz ?
  913.           splitted_bsz : remaining;
  914.         if ((x = write(ttyfd, buf, thiswrite)) > 0)
  915.           msleep(x/(wslots > 1 ? 5 : 10));
  916.         debug(F101,"ttol splitted","",x);
  917.         if (x != thiswrite) {
  918.             if (x < 0 && remaining < n)
  919.             x = 0; /* i.e. report error only on 1st write */
  920.             if (x >= 0)
  921.             x += n - remaining;
  922.             break; /* error, or partial write */
  923.         }
  924.         buf += x;
  925.         if ((remaining -= x) == 0) {
  926.             x = n;
  927.             break; /* success */
  928.         }
  929.         }
  930.     }
  931. -- 
  932. Fulvio MARINO (Tel.#: +39-125-52-8493)
  933. Ing. C. Olivetti & C.
  934. OS&N/R&D/MV Progetto X/OS, n.ico 2p.
  935. via Jervis 77
  936. I-10015 Ivrea (TO)
  937. ITALY
  938.  
  939. ------------------------------
  940.